package com.zrwl.poscloud.commons.feign;

import com.zrwl.poscloud.commons.config.feign.FeignConfiguration;
import com.zrwl.poscloud.commons.fallback.ProxyFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * proxy相关接口
 * 注释以后就不会再尝试获取proxy的微服务了
 *
 * @author liusitong
 */
@FeignClient(name = "pms-proxy", configuration = FeignConfiguration.class, fallback = ProxyFeignFallback.class)
public interface ProxyFeignClient {

    /**
     * 获取accessToken
     */
    @RequestMapping(value = "/weixin/getAccessToken", method = RequestMethod.GET)
    String getAccessToken();

    /**
     * getOpenId
     */
    @RequestMapping("/weixin/getOpenId")
    public String getOpenId(@RequestParam("code") String code);
    /**
     * getUserInfo
     */
    @RequestMapping("/weixin/getUserInfo")
    public String getUserInfo(@RequestParam("openId") String openId, @RequestParam("accessToken") String accessToken);
}